package com.edroid.autorunner;

import java.io.File;

import android.support.v4.os.EConstants;

import com.example.utils.KvTool;

public class Statics {
    public static boolean changeAid, changeSid, changeSsid, changeBsid;
    public static boolean makeNumber;
    public static boolean autoInstall;
    public static boolean hookLocalIp;
    public static boolean hookLocation;
    
    public static int appTime;
    
    
    public static void read() {
    	KvTool sp = new KvTool(new File(EConstants.ROOT_PATH, "global_settings.ekv"));
    	
        changeAid = sp.getBoolean("changeAid", true);
        changeSid = sp.getBoolean("changeSid", true);
        changeSsid = sp.getBoolean("changeSsid", true);
        changeBsid = sp.getBoolean("changeBsid", true);
        autoInstall =  sp.getBoolean("autoInstall", false);
        makeNumber =  sp.getBoolean("makeNumber", false);
        hookLocalIp =  sp.getBoolean("hookLocalIp", false);
        hookLocation =  sp.getBoolean("hookLocation", false);
    }
    
    public static void save() {
        KvTool sp = new KvTool(new File(EConstants.ROOT_PATH, "global_settings.ekv"));
        
        sp.putBoolean("changeAid", changeAid)
        .putBoolean("changeSid", changeSid)
        .putBoolean("changeSsid", changeSsid)
        .putBoolean("changeBsid", changeBsid)
        .putBoolean("autoInstall", autoInstall)
        .putBoolean("makeNumber", makeNumber)
        .putBoolean("hookLocalIp", hookLocalIp)
        .putBoolean("hookLocation", hookLocation)
        .commit();
    }
    
}
